﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class AudioManager : MonoSingleton<AudioManager>
{
    AudioSource audioSource;

    public override void Initialize()
    {
        base.Initialize();
        audioSource = transform.GetComponent<AudioSource>();
    }

    public override void Release()
    {
        base.Release();
    }

    public void PlaySound()
    {
        audioSource.Play();
    }

    public void PauseSound()
    {
        audioSource.Pause();
    }

    public void ResetSound()
    {
        audioSource.Stop();
    }

    public void PlayAudioClip(string name)
    {
        string path = string.Format("Sound/{0}", name);
        AudioClip audioClip = Resources.Load<AudioClip>(path);
        audioSource.clip = audioClip;
        audioSource.Play();
    }
}
